﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Windows;
using System.ComponentModel;

namespace Model.Events
{
    public class Log : INotifyPropertyChanged
    {
        private List<String> _list;

        public Log()
        {
            _list = new List<String>();
            _list.Add("string1");
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public String LogList
        {
            get { return list; }
        }

        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {                
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        public String list
        {
            get
            {
                String str = "";
                foreach (String s in _list)
                {
                    str += " " + s;
                }
                return str;                
            }            
        }

        private Random r = new Random();
        public void change()
        {

            _list.RemoveAt(0);
            _list.Insert(0, "" + r.Next(1000));
            NotifyPropertyChanged("LogList");
        }
    }
}
